package com.bydq.patrolsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bydq.patrolsystem.entity.PsSystemconfig;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 写代码是不可能写代码的啦~~
 * @since 2020-05-22
 */
@Mapper
@Repository   //不加这个装配的时候会报红
public interface PsSystemconfigMapper extends BaseMapper<PsSystemconfig> {


    @Select("SELECT * FROM ps_systemconfig WHERE configCode='RUNNING_STATUS'")
    List<PsSystemconfig> getSystemconfig();

    @Delete("delete from ps_systemconfig where configCode=#{configCode}")
    boolean del(String configCode);

    @Update("update ps_systemconfig set isStart=#{isStart} where configCode=#{configCode}")
    boolean upIsStart(String configCode, int isStart);

    @Select("SELECT * FROM ps_systemconfig where configCode=#{configCode}")
    List<PsSystemconfig> filsList(String configCode);
}
